home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / LDB171.ARJ / EXAMP304.CPP < prev    next >
Text File  |  1992-05-12  |  667b  |  25 lines

  1.      // examp304.cpp - link with binder.obj
  2.  
  3.      #include "binder.hpp"
  4.  
  5.      int v[] = {  25, 3, 43, 17, 7, 35, 3 };
  6.  
  7.      int intcmp(const int *I1, const int *I2)
  8.           { return (*I1 - *I2); }
  9.  
  10.      main()
  11.      {
  12.           Binder b;
  13.  
  14.           b.setComP ((BDRcomP) intcmp);
  15.           for (int i = 0; i < sizeof(v)/sizeof(v[0]); i++)
  16.                b.insSort ((voiD) &v[i]);
  17.           i = 3;
  18.           cout << "\n" << b.findAll(&i) << "   " << i 
  19.                << "'s are present in the following "
  20.                "sort Binder.\n\n";
  21.           while (b.next())
  22.                cout << *(int *)b.get() << "\n";
  23.           return 0;
  24.      }
  25.